<%@page import="java.util.ArrayList"%>
<%@page import="drukarnia.model.Orders"%>
<%@page import="drukarnia.controller.OrderManager"%>
<%@page import="java.util.List"%>
<%@page import="drukarnia.model.User"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page errorPage="WEB-INF/bledy.jsp"%>
    
	<%
	User user = (User)session.getAttribute("user");
	if(user != null){
		if(request.getParameter("correct") == null || request.getParameter("correct")== ""){
			
		}else{
			OrderManager om = new OrderManager();
			om.deleteOrderFromDB(Integer.parseInt(request.getParameter("correct")));
		}
	%>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Drukarnia</title>
<link rel="stylesheet" type="text/css" href="style.css" />
   <link href="css/default.css" rel="stylesheet" type="text/css" />
<link href="css/uploadify.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="scripts/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="scripts/swfobject.js"></script>
<script type="text/javascript" src="scripts/jquery.uploadify.v2.1.4.min.js"></script>

<script type="text/javascript">
	$(document).ready(function() {
		$("#uploadify").uploadify({
			'uploader' : 'scripts/uploadify.swf',
			'script' : 'servlet/Upload?mail=<%=user.getMail() %>',
			'cancelImg' : 'images/cancel.png',
			'folder' : 'uploads',
			'queueID' : 'fileQueue',
			'queueSizeLimit' : 1,
			'fileDesc' : 'tif,tiff,jpg,bmp,jpeg,eps,pdf',
			'fileExt' : '*.tif;*.tiff;*.jpg;*.bmp;*.jpeg;*.eps;*.pdf',
			'auto' : false,
			'multi' : false,
			'simUploadLimit' : 2,
			'buttonText' : 'Wybierz plik',
			'removeCompleted' : false,
			'onComplete': function(event, queueID, fileObj, response, data) {
				  location.href = "addOrderDetails.jsp?fileName="+ fileObj.name;
			}
		});
	});
</script>
</head>
 
<body>
<div id="header">
					<ul>
						<li><a href="index.jsp" class="first">Moje konto</a></li>
						<li><a href="#" class="second_selected">Wgraj pliki</a></li>
						<li><a href="#" class="third">Potwierdź dane</a></li>	
					</ul>
				</div>
				<div id="content">
	<center>
		<table border=0 style="text-align: left;">
<!-- 			<tr> -->
<!-- 				<td><center><h3>Złóż zamówienie krok 1/2</h3></center></td> -->
<!-- 			</tr> -->
			<tr>
				
				<td>
				
					<div id="fileQueue"></div>
					<p>
					<input type="file" name="uploadify" id="uploadify" />
					<p>
						<a class="classname" href="javascript:jQuery('#uploadify').uploadifyUpload()">Rozpocznij wgrywanie plików</a> 
						<a class="classname" href="javascript:jQuery('#uploadify').uploadifyClearQueue()">Wyczyść</a>
					</p>
				</td>
			</tr>
		</table>
	</center>
	</div>	
	 <div id="content">
 Masz problem ze złożeniem zamówienia? Napisz do nas: <a href="mailto:biuro@mocnydruk.pl">biuro@mocnydruk.pl</a>
 </div>
</body>
</html>


<%
			}
		else{
		response.sendError(404,"Drukarnia: brak uprawnien");
			}
	%>